<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>  
<%@ taglib uri="/struts-dojo-tags" prefix="sx" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<sx:head/>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>首頁</title>
	<!-- Jquery DatePicker -->
	<script type="text/javascript" src="js/jquery-1.9.1.js"></script> 
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script type="text/javascript" src="js/jquery-ui-datepicker.js"></script>
	<script type="text/javascript">
		$(function(){
			$("#PDate").datepicker();
			
		});
	</script>
	<link rel="stylesheet" type="text/css" href="css/jquery-ui.css" />
	<style type="text/css">
		body{font:12px/18px Tahoma; }
		.demo h4{height:32px; line-height:32px; font-size:14px}
		.demo h4 span{font-weight:500; font-size:12px}
		.demo p{line-height:28px;}
	</style>
</head>
<body>
新增店員資料
<s:form id="form1" name="form1" action="action1!insert2">
	<table border="1">
		<tr>
			<td>
				店員姓名
			</td>
			<td>
				<input type="text" id="PName" name="PName"/>
			</td>
		</tr>
		<tr>
			<td>
				店員住址
			</td>
			<td>
				<input type="text" id="PAddress" name="PAddress"/>
			</td>
		</tr>
		<tr>
			<td>
				店員電話
			</td>
			<td>
				<input type="text" id="PTel" name="PTel"/>
			</td>
		</tr>
		<tr>
			<td>
				店員到職日
			</td>
			<td>
<!-- 				<input type="text" id="PDate" readonly class="demo"/> -->
				<s:date name="PDate" format="yyyy-MM-dd" /> 
				<sx:datetimepicker value="today" name="PDate" type="date" displayFormat="yyyy-MM-dd"></sx:datetimepicker>
			</td>
		</tr>
		<tr>
			<td>
				所屬店
			</td>
			<td>
				<select name="SID">
					<c:if test="${storeList ne null }">
						<c:forEach items="${storeList }" var="data">
							<option value="${data.SID }">${data.SNAME }</option>
						</c:forEach>
					</c:if>
				</select>
			</td>
		</tr>
	</table>
	<input type="submit" value="送出" onclick="return validate()"/>
</s:form>
</body>
</html>
<script>
	function validate(){
		if(document.getElementById("SName").value == ""){
			alert("店-名稱不得為空");
		}else if(document.getElementById("SAddress").value == ""){
			alert("店-地址不得為空");
		}else if(document.getElementById("STel").value == ""){
			alert("店-電話不得為空");
		}else if(document.getElementById("PName").value == ""){
			alert("店-店長姓名不得為空");
		}else if(document.getElementById("PAddress").value == ""){
			alert("店-店長住址不得為空");
		}else if(document.getElementById("PTel").value == ""){
			alert("店-店長電話不得為空");
		}else if(document.getElementById("PDate").value == ""){
			alert("店-店長到職日不得為空");
		}else{
			return true;
		}
		return false;
	}
</script>


